from django.db.models import QuerySet

from server.apps.blogs.models import BlogPost


def list_published() -> QuerySet[BlogPost]:
    """Returns all BlogPosts that are ready to be published."""
    return BlogPost.objects.all().order_by('created_at')#.filter(is_published=True)

def sluged(slug) -> int:
    """Returns all BlogPosts that are ready to be published."""
    return BlogPost.objects.filter(slug=slug)

